package com.chuangjiangx.member.manager.basic.web.config.springsession;

import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;

/**
 * @author cj-ch
 * @date 2018/8/16 下午7:55
 */
@Slf4j
public class CustomerJdkSerializationRedisSerializer extends JdkSerializationRedisSerializer {
    @Override
    public Object deserialize(byte[] bytes) {
        Object obj = null;
        try {
            obj = super.deserialize(bytes);
        } catch (Exception e) {
            log.info("反序列化异常:",e);
        }
        return obj;
    }

    @Override
    public byte[] serialize(Object object) {
        byte[] bytes = null;
        try {
            bytes = super.serialize(object);
        } catch (Exception e) {
            log.info("序列化异常:",e);
        }
        return bytes;
    }
}
